package link.anycar.study.current.semaphore;

public class Job {

    private int index;
    private long timeNeeded;

    public Job(int index, long timeNeeded) {
        this.index = index;
        this.timeNeeded = timeNeeded;
    }

    public long getTimeNeeded() {
        return timeNeeded;
    }

    public void setTimeNeeded(long timeNeeded) {
        this.timeNeeded = timeNeeded;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public int getPermitsNeeded() {
        return timeNeeded > 1000 ? 2 : 1;
    }

    public boolean isHeavyJob() {
        return timeNeeded > 1000;
    }

}
